// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
// an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.

//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by google-apis-code-generator 1.5.1
//     C# generator version: 1.22.0
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

/**
 * \brief
 *   CustomSearch API Version v1
 *
 * \section ApiInfo API Version Information
 *    <table>
 *      <tr><th>API
 *          <td><a href='https://developers.google.com/custom-search/v1/using_rest'>CustomSearch API</a>
 *      <tr><th>API Version<td>v1
 *      <tr><th>API Rev<td>20160411 (466)
 *      <tr><th>API Docs
 *          <td><a href='https://developers.google.com/custom-search/v1/using_rest'>
 *              https://developers.google.com/custom-search/v1/using_rest</a>
 *      <tr><th>Discovery Name<td>customsearch
 *    </table>
 *
 * \section ForMoreInfo For More Information
 *
 * The complete API documentation for using CustomSearch API can be found at
 * <a href='https://developers.google.com/custom-search/v1/using_rest'>https://developers.google.com/custom-search/v1/using_rest</a>.
 *
 * For more information about the Google APIs Client Library for .NET, see
 * <a href='https://developers.google.com/api-client-library/dotnet/get_started'>
 * https://developers.google.com/api-client-library/dotnet/get_started</a>
 */

namespace Google.Apis.Customsearch.v1
{
    /// <summary>The Customsearch Service.</summary>
    public class CustomsearchService : Google.Apis.Services.BaseClientService
    {
        /// <summary>The API version.</summary>
        public const string Version = "v1";

        /// <summary>The discovery version used to generate this service.</summary>
        public static Google.Apis.Discovery.DiscoveryVersion DiscoveryVersionUsed =
            Google.Apis.Discovery.DiscoveryVersion.Version_1_0;

        /// <summary>Constructs a new service.</summary>
        public CustomsearchService() :
            this(new Google.Apis.Services.BaseClientService.Initializer()) {}

        /// <summary>Constructs a new service.</summary>
        /// <param name="initializer">The service initializer.</param>
        public CustomsearchService(Google.Apis.Services.BaseClientService.Initializer initializer)
            : base(initializer)
        {
            cse = new CseResource(this);
        }

        /// <summary>Gets the service supported features.</summary>
        public override System.Collections.Generic.IList<string> Features
        {
            get { return new string[0]; }
        }

        /// <summary>Gets the service name.</summary>
        public override string Name
        {
            get { return "customsearch"; }
        }

        /// <summary>Gets the service base URI.</summary>
        public override string BaseUri
        {
            get { return "https://www.googleapis.com/customsearch/"; }
        }

        /// <summary>Gets the service base path.</summary>
        public override string BasePath
        {
            get { return "customsearch/"; }
        }





        private readonly CseResource cse;

        /// <summary>Gets the Cse resource.</summary>
        public virtual CseResource Cse
        {
            get { return cse; }
        }
    }

    ///<summary>A base abstract class for Customsearch requests.</summary>
    public abstract class CustomsearchBaseServiceRequest<TResponse> : Google.Apis.Requests.ClientServiceRequest<TResponse>
    {
        ///<summary>Constructs a new CustomsearchBaseServiceRequest instance.</summary>
        protected CustomsearchBaseServiceRequest(Google.Apis.Services.IClientService service)
            : base(service)
        {
        }

        /// <summary>Data format for the response.</summary>
        /// [default: json]
        [Google.Apis.Util.RequestParameterAttribute("alt", Google.Apis.Util.RequestParameterType.Query)]
        public virtual System.Nullable<AltEnum> Alt { get; set; }

        /// <summary>Data format for the response.</summary>
        public enum AltEnum
        {
            /// <summary>Responses with Content-Type of application/atom+xml</summary>
            [Google.Apis.Util.StringValueAttribute("atom")]
            Atom,
            /// <summary>Responses with Content-Type of application/json</summary>
            [Google.Apis.Util.StringValueAttribute("json")]
            Json,
        }

        /// <summary>Selector specifying which fields to include in a partial response.</summary>
        [Google.Apis.Util.RequestParameterAttribute("fields", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string Fields { get; set; }

        /// <summary>API key. Your API key identifies your project and provides you with API access, quota, and reports.
        /// Required unless you provide an OAuth 2.0 token.</summary>
        [Google.Apis.Util.RequestParameterAttribute("key", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string Key { get; set; }

        /// <summary>OAuth 2.0 token for the current user.</summary>
        [Google.Apis.Util.RequestParameterAttribute("oauth_token", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string OauthToken { get; set; }

        /// <summary>Returns response with indentations and line breaks.</summary>
        /// [default: true]
        [Google.Apis.Util.RequestParameterAttribute("prettyPrint", Google.Apis.Util.RequestParameterType.Query)]
        public virtual System.Nullable<bool> PrettyPrint { get; set; }

        /// <summary>Available to use for quota purposes for server-side applications. Can be any arbitrary string
        /// assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.</summary>
        [Google.Apis.Util.RequestParameterAttribute("quotaUser", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string QuotaUser { get; set; }

        /// <summary>IP address of the site where the request originates. Use this if you want to enforce per-user
        /// limits.</summary>
        [Google.Apis.Util.RequestParameterAttribute("userIp", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string UserIp { get; set; }

        /// <summary>Initializes Customsearch parameter list.</summary>
        protected override void InitParameters()
        {
            base.InitParameters();

            RequestParameters.Add(
                "alt", new Google.Apis.Discovery.Parameter
                {
                    Name = "alt",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = "json",
                    Pattern = null,
                });
            RequestParameters.Add(
                "fields", new Google.Apis.Discovery.Parameter
                {
                    Name = "fields",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "key", new Google.Apis.Discovery.Parameter
                {
                    Name = "key",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "oauth_token", new Google.Apis.Discovery.Parameter
                {
                    Name = "oauth_token",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "prettyPrint", new Google.Apis.Discovery.Parameter
                {
                    Name = "prettyPrint",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = "true",
                    Pattern = null,
                });
            RequestParameters.Add(
                "quotaUser", new Google.Apis.Discovery.Parameter
                {
                    Name = "quotaUser",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "userIp", new Google.Apis.Discovery.Parameter
                {
                    Name = "userIp",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
        }
    }

    /// <summary>The "cse" collection of methods.</summary>
    public class CseResource
    {
        private const string Resource = "cse";

        /// <summary>The service which this resource belongs to.</summary>
        private readonly Google.Apis.Services.IClientService service;

        /// <summary>Constructs a new resource.</summary>
        public CseResource(Google.Apis.Services.IClientService service)
        {
            this.service = service;

        }


        /// <summary>Returns metadata about the search performed, metadata about the custom search engine used for the
        /// search, and the search results.</summary>
        /// <param name="q">Query</param>
        public virtual ListRequest List(string q)
        {
            return new ListRequest(service, q);
        }

        /// <summary>Returns metadata about the search performed, metadata about the custom search engine used for the
        /// search, and the search results.</summary>
        public class ListRequest : CustomsearchBaseServiceRequest<Google.Apis.Customsearch.v1.Data.Search>
        {
            /// <summary>Constructs a new List request.</summary>
            public ListRequest(Google.Apis.Services.IClientService service, string q)
                : base(service)
            {
                Q = q;
                InitParameters();
            }


            /// <summary>Query</summary>
            [Google.Apis.Util.RequestParameterAttribute("q", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string Q { get; private set; }

            /// <summary>Turns off the translation between zh-CN and zh-TW.</summary>
            [Google.Apis.Util.RequestParameterAttribute("c2coff", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string C2coff { get; set; }

            /// <summary>Country restrict(s).</summary>
            [Google.Apis.Util.RequestParameterAttribute("cr", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string Cr { get; set; }

            /// <summary>The URL of a linked custom search engine</summary>
            [Google.Apis.Util.RequestParameterAttribute("cref", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string Cref { get; set; }

            /// <summary>The custom search engine ID to scope this search query</summary>
            [Google.Apis.Util.RequestParameterAttribute("cx", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string Cx { get; set; }

            /// <summary>Specifies all search results are from a time period</summary>
            [Google.Apis.Util.RequestParameterAttribute("dateRestrict", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string DateRestrict { get; set; }

            /// <summary>Identifies a phrase that all documents in the search results must contain</summary>
            [Google.Apis.Util.RequestParameterAttribute("exactTerms", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string ExactTerms { get; set; }

            /// <summary>Identifies a word or phrase that should not appear in any documents in the search
            /// results</summary>
            [Google.Apis.Util.RequestParameterAttribute("excludeTerms", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string ExcludeTerms { get; set; }

            /// <summary>Returns images of a specified type. Some of the allowed values are: bmp, gif, png, jpg, svg,
            /// pdf, ...</summary>
            [Google.Apis.Util.RequestParameterAttribute("fileType", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string FileType { get; set; }

            /// <summary>Controls turning on or off the duplicate content filter.</summary>
            [Google.Apis.Util.RequestParameterAttribute("filter", Google.Apis.Util.RequestParameterType.Query)]
            public virtual System.Nullable<FilterEnum> Filter { get; set; }

            /// <summary>Controls turning on or off the duplicate content filter.</summary>
            public enum FilterEnum
            {
                /// <summary>Turns off duplicate content filter.</summary>
                [Google.Apis.Util.StringValueAttribute("0")]
                Value0,
                /// <summary>Turns on duplicate content filter.</summary>
                [Google.Apis.Util.StringValueAttribute("1")]
                Value1,
            }

            /// <summary>Geolocation of end user.</summary>
            [Google.Apis.Util.RequestParameterAttribute("gl", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string Gl { get; set; }

            /// <summary>The local Google domain to use to perform the search.</summary>
            [Google.Apis.Util.RequestParameterAttribute("googlehost", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string Googlehost { get; set; }

            /// <summary>Creates a range in form as_nlo value..as_nhi value and attempts to append it to query</summary>
            [Google.Apis.Util.RequestParameterAttribute("highRange", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string HighRange { get; set; }

            /// <summary>Sets the user interface language.</summary>
            [Google.Apis.Util.RequestParameterAttribute("hl", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string Hl { get; set; }

            /// <summary>Appends the extra query terms to the query.</summary>
            [Google.Apis.Util.RequestParameterAttribute("hq", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string Hq { get; set; }

            /// <summary>Returns black and white, grayscale, or color images: mono, gray, and color.</summary>
            [Google.Apis.Util.RequestParameterAttribute("imgColorType", Google.Apis.Util.RequestParameterType.Query)]
            public virtual System.Nullable<ImgColorTypeEnum> ImgColorType { get; set; }

            /// <summary>Returns black and white, grayscale, or color images: mono, gray, and color.</summary>
            public enum ImgColorTypeEnum
            {
                /// <summary>color</summary>
                [Google.Apis.Util.StringValueAttribute("color")]
                Color,
                /// <summary>gray</summary>
                [Google.Apis.Util.StringValueAttribute("gray")]
                Gray,
                /// <summary>mono</summary>
                [Google.Apis.Util.StringValueAttribute("mono")]
                Mono,
            }

            /// <summary>Returns images of a specific dominant color: yellow, green, teal, blue, purple, pink, white,
            /// gray, black and brown.</summary>
            [Google.Apis.Util.RequestParameterAttribute("imgDominantColor", Google.Apis.Util.RequestParameterType.Query)]
            public virtual System.Nullable<ImgDominantColorEnum> ImgDominantColor { get; set; }

            /// <summary>Returns images of a specific dominant color: yellow, green, teal, blue, purple, pink, white,
            /// gray, black and brown.</summary>
            public enum ImgDominantColorEnum
            {
                /// <summary>black</summary>
                [Google.Apis.Util.StringValueAttribute("black")]
                Black,
                /// <summary>blue</summary>
                [Google.Apis.Util.StringValueAttribute("blue")]
                Blue,
                /// <summary>brown</summary>
                [Google.Apis.Util.StringValueAttribute("brown")]
                Brown,
                /// <summary>gray</summary>
                [Google.Apis.Util.StringValueAttribute("gray")]
                Gray,
                /// <summary>green</summary>
                [Google.Apis.Util.StringValueAttribute("green")]
                Green,
                /// <summary>pink</summary>
                [Google.Apis.Util.StringValueAttribute("pink")]
                Pink,
                /// <summary>purple</summary>
                [Google.Apis.Util.StringValueAttribute("purple")]
                Purple,
                /// <summary>teal</summary>
                [Google.Apis.Util.StringValueAttribute("teal")]
                Teal,
                /// <summary>white</summary>
                [Google.Apis.Util.StringValueAttribute("white")]
                White,
                /// <summary>yellow</summary>
                [Google.Apis.Util.StringValueAttribute("yellow")]
                Yellow,
            }

            /// <summary>Returns images of a specified size, where size can be one of: icon, small, medium, large,
            /// xlarge, xxlarge, and huge.</summary>
            [Google.Apis.Util.RequestParameterAttribute("imgSize", Google.Apis.Util.RequestParameterType.Query)]
            public virtual System.Nullable<ImgSizeEnum> ImgSize { get; set; }

            /// <summary>Returns images of a specified size, where size can be one of: icon, small, medium, large,
            /// xlarge, xxlarge, and huge.</summary>
            public enum ImgSizeEnum
            {
                /// <summary>huge</summary>
                [Google.Apis.Util.StringValueAttribute("huge")]
                Huge,
                /// <summary>icon</summary>
                [Google.Apis.Util.StringValueAttribute("icon")]
                Icon,
                /// <summary>large</summary>
                [Google.Apis.Util.StringValueAttribute("large")]
                Large,
                /// <summary>medium</summary>
                [Google.Apis.Util.StringValueAttribute("medium")]
                Medium,
                /// <summary>small</summary>
                [Google.Apis.Util.StringValueAttribute("small")]
                Small,
                /// <summary>xlarge</summary>
                [Google.Apis.Util.StringValueAttribute("xlarge")]
                Xlarge,
                /// <summary>xxlarge</summary>
                [Google.Apis.Util.StringValueAttribute("xxlarge")]
                Xxlarge,
            }

            /// <summary>Returns images of a type, which can be one of: clipart, face, lineart, news, and
            /// photo.</summary>
            [Google.Apis.Util.RequestParameterAttribute("imgType", Google.Apis.Util.RequestParameterType.Query)]
            public virtual System.Nullable<ImgTypeEnum> ImgType { get; set; }

            /// <summary>Returns images of a type, which can be one of: clipart, face, lineart, news, and
            /// photo.</summary>
            public enum ImgTypeEnum
            {
                /// <summary>clipart</summary>
                [Google.Apis.Util.StringValueAttribute("clipart")]
                Clipart,
                /// <summary>face</summary>
                [Google.Apis.Util.StringValueAttribute("face")]
                Face,
                /// <summary>lineart</summary>
                [Google.Apis.Util.StringValueAttribute("lineart")]
                Lineart,
                /// <summary>news</summary>
                [Google.Apis.Util.StringValueAttribute("news")]
                News,
                /// <summary>photo</summary>
                [Google.Apis.Util.StringValueAttribute("photo")]
                Photo,
            }

            /// <summary>Specifies that all search results should contain a link to a particular URL</summary>
            [Google.Apis.Util.RequestParameterAttribute("linkSite", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string LinkSite { get; set; }

            /// <summary>Creates a range in form as_nlo value..as_nhi value and attempts to append it to query</summary>
            [Google.Apis.Util.RequestParameterAttribute("lowRange", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string LowRange { get; set; }

            /// <summary>The language restriction for the search results</summary>
            [Google.Apis.Util.RequestParameterAttribute("lr", Google.Apis.Util.RequestParameterType.Query)]
            public virtual System.Nullable<LrEnum> Lr { get; set; }

            /// <summary>The language restriction for the search results</summary>
            public enum LrEnum
            {
                /// <summary>Arabic</summary>
                [Google.Apis.Util.StringValueAttribute("lang_ar")]
                LangAr,
                /// <summary>Bulgarian</summary>
                [Google.Apis.Util.StringValueAttribute("lang_bg")]
                LangBg,
                /// <summary>Catalan</summary>
                [Google.Apis.Util.StringValueAttribute("lang_ca")]
                LangCa,
                /// <summary>Czech</summary>
                [Google.Apis.Util.StringValueAttribute("lang_cs")]
                LangCs,
                /// <summary>Danish</summary>
                [Google.Apis.Util.StringValueAttribute("lang_da")]
                LangDa,
                /// <summary>German</summary>
                [Google.Apis.Util.StringValueAttribute("lang_de")]
                LangDe,
                /// <summary>Greek</summary>
                [Google.Apis.Util.StringValueAttribute("lang_el")]
                LangEl,
                /// <summary>English</summary>
                [Google.Apis.Util.StringValueAttribute("lang_en")]
                LangEn,
                /// <summary>Spanish</summary>
                [Google.Apis.Util.StringValueAttribute("lang_es")]
                LangEs,
                /// <summary>Estonian</summary>
                [Google.Apis.Util.StringValueAttribute("lang_et")]
                LangEt,
                /// <summary>Finnish</summary>
                [Google.Apis.Util.StringValueAttribute("lang_fi")]
                LangFi,
                /// <summary>French</summary>
                [Google.Apis.Util.StringValueAttribute("lang_fr")]
                LangFr,
                /// <summary>Croatian</summary>
                [Google.Apis.Util.StringValueAttribute("lang_hr")]
                LangHr,
                /// <summary>Hungarian</summary>
                [Google.Apis.Util.StringValueAttribute("lang_hu")]
                LangHu,
                /// <summary>Indonesian</summary>
                [Google.Apis.Util.StringValueAttribute("lang_id")]
                LangId,
                /// <summary>Icelandic</summary>
                [Google.Apis.Util.StringValueAttribute("lang_is")]
                LangIs,
                /// <summary>Italian</summary>
                [Google.Apis.Util.StringValueAttribute("lang_it")]
                LangIt,
                /// <summary>Hebrew</summary>
                [Google.Apis.Util.StringValueAttribute("lang_iw")]
                LangIw,
                /// <summary>Japanese</summary>
                [Google.Apis.Util.StringValueAttribute("lang_ja")]
                LangJa,
                /// <summary>Korean</summary>
                [Google.Apis.Util.StringValueAttribute("lang_ko")]
                LangKo,
                /// <summary>Lithuanian</summary>
                [Google.Apis.Util.StringValueAttribute("lang_lt")]
                LangLt,
                /// <summary>Latvian</summary>
                [Google.Apis.Util.StringValueAttribute("lang_lv")]
                LangLv,
                /// <summary>Dutch</summary>
                [Google.Apis.Util.StringValueAttribute("lang_nl")]
                LangNl,
                /// <summary>Norwegian</summary>
                [Google.Apis.Util.StringValueAttribute("lang_no")]
                LangNo,
                /// <summary>Polish</summary>
                [Google.Apis.Util.StringValueAttribute("lang_pl")]
                LangPl,
                /// <summary>Portuguese</summary>
                [Google.Apis.Util.StringValueAttribute("lang_pt")]
                LangPt,
                /// <summary>Romanian</summary>
                [Google.Apis.Util.StringValueAttribute("lang_ro")]
                LangRo,
                /// <summary>Russian</summary>
                [Google.Apis.Util.StringValueAttribute("lang_ru")]
                LangRu,
                /// <summary>Slovak</summary>
                [Google.Apis.Util.StringValueAttribute("lang_sk")]
                LangSk,
                /// <summary>Slovenian</summary>
                [Google.Apis.Util.StringValueAttribute("lang_sl")]
                LangSl,
                /// <summary>Serbian</summary>
                [Google.Apis.Util.StringValueAttribute("lang_sr")]
                LangSr,
                /// <summary>Swedish</summary>
                [Google.Apis.Util.StringValueAttribute("lang_sv")]
                LangSv,
                /// <summary>Turkish</summary>
                [Google.Apis.Util.StringValueAttribute("lang_tr")]
                LangTr,
                /// <summary>Chinese (Simplified)</summary>
                [Google.Apis.Util.StringValueAttribute("lang_zh-CN")]
                LangZhCN,
                /// <summary>Chinese (Traditional)</summary>
                [Google.Apis.Util.StringValueAttribute("lang_zh-TW")]
                LangZhTW,
            }

            /// <summary>Number of search results to return</summary>
            /// [default: 10]
            [Google.Apis.Util.RequestParameterAttribute("num", Google.Apis.Util.RequestParameterType.Query)]
            public virtual System.Nullable<long> Num { get; set; }

            /// <summary>Provides additional search terms to check for in a document, where each document in the search
            /// results must contain at least one of the additional search terms</summary>
            [Google.Apis.Util.RequestParameterAttribute("orTerms", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string OrTerms { get; set; }

            /// <summary>Specifies that all search results should be pages that are related to the specified
            /// URL</summary>
            [Google.Apis.Util.RequestParameterAttribute("relatedSite", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string RelatedSite { get; set; }

            /// <summary>Filters based on licensing. Supported values include: cc_publicdomain, cc_attribute,
            /// cc_sharealike, cc_noncommercial, cc_nonderived and combinations of these.</summary>
            [Google.Apis.Util.RequestParameterAttribute("rights", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string Rights { get; set; }

            /// <summary>Search safety level</summary>
            /// [default: off]
            [Google.Apis.Util.RequestParameterAttribute("safe", Google.Apis.Util.RequestParameterType.Query)]
            public virtual System.Nullable<SafeEnum> Safe { get; set; }

            /// <summary>Search safety level</summary>
            public enum SafeEnum
            {
                /// <summary>Enables highest level of safe search filtering.</summary>
                [Google.Apis.Util.StringValueAttribute("high")]
                High,
                /// <summary>Enables moderate safe search filtering.</summary>
                [Google.Apis.Util.StringValueAttribute("medium")]
                Medium,
                /// <summary>Disables safe search filtering.</summary>
                [Google.Apis.Util.StringValueAttribute("off")]
                Off,
            }

            /// <summary>Specifies the search type: image.</summary>
            [Google.Apis.Util.RequestParameterAttribute("searchType", Google.Apis.Util.RequestParameterType.Query)]
            public virtual System.Nullable<SearchTypeEnum> SearchType { get; set; }

            /// <summary>Specifies the search type: image.</summary>
            public enum SearchTypeEnum
            {
                /// <summary>custom image search</summary>
                [Google.Apis.Util.StringValueAttribute("image")]
                Image,
            }

            /// <summary>Specifies all search results should be pages from a given site</summary>
            [Google.Apis.Util.RequestParameterAttribute("siteSearch", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string SiteSearch { get; set; }

            /// <summary>Controls whether to include or exclude results from the site named in the as_sitesearch
            /// parameter</summary>
            [Google.Apis.Util.RequestParameterAttribute("siteSearchFilter", Google.Apis.Util.RequestParameterType.Query)]
            public virtual System.Nullable<SiteSearchFilterEnum> SiteSearchFilter { get; set; }

            /// <summary>Controls whether to include or exclude results from the site named in the as_sitesearch
            /// parameter</summary>
            public enum SiteSearchFilterEnum
            {
                /// <summary>exclude</summary>
                [Google.Apis.Util.StringValueAttribute("e")]
                E,
                /// <summary>include</summary>
                [Google.Apis.Util.StringValueAttribute("i")]
                I,
            }

            /// <summary>The sort expression to apply to the results</summary>
            [Google.Apis.Util.RequestParameterAttribute("sort", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string Sort { get; set; }

            /// <summary>The index of the first result to return</summary>
            [Google.Apis.Util.RequestParameterAttribute("start", Google.Apis.Util.RequestParameterType.Query)]
            public virtual System.Nullable<long> Start { get; set; }


            ///<summary>Gets the method name.</summary>
            public override string MethodName
            {
                get { return "list"; }
            }

            ///<summary>Gets the HTTP method.</summary>
            public override string HttpMethod
            {
                get { return "GET"; }
            }

            ///<summary>Gets the REST path.</summary>
            public override string RestPath
            {
                get { return "v1"; }
            }

            /// <summary>Initializes List parameter list.</summary>
            protected override void InitParameters()
            {
                base.InitParameters();

                RequestParameters.Add(
                    "q", new Google.Apis.Discovery.Parameter
                    {
                        Name = "q",
                        IsRequired = true,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "c2coff", new Google.Apis.Discovery.Parameter
                    {
                        Name = "c2coff",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "cr", new Google.Apis.Discovery.Parameter
                    {
                        Name = "cr",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "cref", new Google.Apis.Discovery.Parameter
                    {
                        Name = "cref",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "cx", new Google.Apis.Discovery.Parameter
                    {
                        Name = "cx",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "dateRestrict", new Google.Apis.Discovery.Parameter
                    {
                        Name = "dateRestrict",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "exactTerms", new Google.Apis.Discovery.Parameter
                    {
                        Name = "exactTerms",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "excludeTerms", new Google.Apis.Discovery.Parameter
                    {
                        Name = "excludeTerms",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "fileType", new Google.Apis.Discovery.Parameter
                    {
                        Name = "fileType",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "filter", new Google.Apis.Discovery.Parameter
                    {
                        Name = "filter",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "gl", new Google.Apis.Discovery.Parameter
                    {
                        Name = "gl",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "googlehost", new Google.Apis.Discovery.Parameter
                    {
                        Name = "googlehost",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "highRange", new Google.Apis.Discovery.Parameter
                    {
                        Name = "highRange",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "hl", new Google.Apis.Discovery.Parameter
                    {
                        Name = "hl",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "hq", new Google.Apis.Discovery.Parameter
                    {
                        Name = "hq",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "imgColorType", new Google.Apis.Discovery.Parameter
                    {
                        Name = "imgColorType",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "imgDominantColor", new Google.Apis.Discovery.Parameter
                    {
                        Name = "imgDominantColor",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "imgSize", new Google.Apis.Discovery.Parameter
                    {
                        Name = "imgSize",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "imgType", new Google.Apis.Discovery.Parameter
                    {
                        Name = "imgType",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "linkSite", new Google.Apis.Discovery.Parameter
                    {
                        Name = "linkSite",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "lowRange", new Google.Apis.Discovery.Parameter
                    {
                        Name = "lowRange",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "lr", new Google.Apis.Discovery.Parameter
                    {
                        Name = "lr",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "num", new Google.Apis.Discovery.Parameter
                    {
                        Name = "num",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = "10",
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "orTerms", new Google.Apis.Discovery.Parameter
                    {
                        Name = "orTerms",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "relatedSite", new Google.Apis.Discovery.Parameter
                    {
                        Name = "relatedSite",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "rights", new Google.Apis.Discovery.Parameter
                    {
                        Name = "rights",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "safe", new Google.Apis.Discovery.Parameter
                    {
                        Name = "safe",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = "off",
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "searchType", new Google.Apis.Discovery.Parameter
                    {
                        Name = "searchType",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "siteSearch", new Google.Apis.Discovery.Parameter
                    {
                        Name = "siteSearch",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "siteSearchFilter", new Google.Apis.Discovery.Parameter
                    {
                        Name = "siteSearchFilter",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "sort", new Google.Apis.Discovery.Parameter
                    {
                        Name = "sort",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "start", new Google.Apis.Discovery.Parameter
                    {
                        Name = "start",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
            }

        }
    }
}

namespace Google.Apis.Customsearch.v1.Data
{    

    public class Context : Google.Apis.Requests.IDirectResponseSchema
    {
        [Newtonsoft.Json.JsonPropertyAttribute("facets")]
        public virtual System.Collections.Generic.IList<System.Collections.Generic.IList<Context.FacetsData>> Facets { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("title")]
        public virtual string Title { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
        

        public class FacetsData
        {
            [Newtonsoft.Json.JsonPropertyAttribute("anchor")]
            public virtual string Anchor { get; set; } 

            [Newtonsoft.Json.JsonPropertyAttribute("label")]
            public virtual string Label { get; set; } 

            [Newtonsoft.Json.JsonPropertyAttribute("label_with_op")]
            public virtual string LabelWithOp { get; set; } 

        }
    }    

    public class Promotion : Google.Apis.Requests.IDirectResponseSchema
    {
        [Newtonsoft.Json.JsonPropertyAttribute("bodyLines")]
        public virtual System.Collections.Generic.IList<Promotion.BodyLinesData> BodyLines { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("displayLink")]
        public virtual string DisplayLink { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("htmlTitle")]
        public virtual string HtmlTitle { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("image")]
        public virtual Promotion.ImageData Image { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("link")]
        public virtual string Link { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("title")]
        public virtual string Title { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
        

        public class BodyLinesData
        {
            [Newtonsoft.Json.JsonPropertyAttribute("htmlTitle")]
            public virtual string HtmlTitle { get; set; } 

            [Newtonsoft.Json.JsonPropertyAttribute("link")]
            public virtual string Link { get; set; } 

            [Newtonsoft.Json.JsonPropertyAttribute("title")]
            public virtual string Title { get; set; } 

            [Newtonsoft.Json.JsonPropertyAttribute("url")]
            public virtual string Url { get; set; } 

        }    

        public class ImageData
        {
            [Newtonsoft.Json.JsonPropertyAttribute("height")]
            public virtual System.Nullable<int> Height { get; set; } 

            [Newtonsoft.Json.JsonPropertyAttribute("source")]
            public virtual string Source { get; set; } 

            [Newtonsoft.Json.JsonPropertyAttribute("width")]
            public virtual System.Nullable<int> Width { get; set; } 

        }
    }    

    public class Query : Google.Apis.Requests.IDirectResponseSchema
    {
        [Newtonsoft.Json.JsonPropertyAttribute("count")]
        public virtual System.Nullable<int> Count { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("cr")]
        public virtual string Cr { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("cref")]
        public virtual string Cref { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("cx")]
        public virtual string Cx { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("dateRestrict")]
        public virtual string DateRestrict { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("disableCnTwTranslation")]
        public virtual string DisableCnTwTranslation { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("exactTerms")]
        public virtual string ExactTerms { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("excludeTerms")]
        public virtual string ExcludeTerms { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("fileType")]
        public virtual string FileType { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("filter")]
        public virtual string Filter { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("gl")]
        public virtual string Gl { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("googleHost")]
        public virtual string GoogleHost { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("highRange")]
        public virtual string HighRange { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("hl")]
        public virtual string Hl { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("hq")]
        public virtual string Hq { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("imgColorType")]
        public virtual string ImgColorType { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("imgDominantColor")]
        public virtual string ImgDominantColor { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("imgSize")]
        public virtual string ImgSize { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("imgType")]
        public virtual string ImgType { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("inputEncoding")]
        public virtual string InputEncoding { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("language")]
        public virtual string Language { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("linkSite")]
        public virtual string LinkSite { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("lowRange")]
        public virtual string LowRange { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("orTerms")]
        public virtual string OrTerms { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("outputEncoding")]
        public virtual string OutputEncoding { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("relatedSite")]
        public virtual string RelatedSite { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("rights")]
        public virtual string Rights { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("safe")]
        public virtual string Safe { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("searchTerms")]
        public virtual string SearchTerms { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("searchType")]
        public virtual string SearchType { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("siteSearch")]
        public virtual string SiteSearch { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("siteSearchFilter")]
        public virtual string SiteSearchFilter { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("sort")]
        public virtual string Sort { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("startIndex")]
        public virtual System.Nullable<int> StartIndex { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("startPage")]
        public virtual System.Nullable<int> StartPage { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("title")]
        public virtual string Title { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("totalResults")]
        public virtual System.Nullable<long> TotalResults { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    public class Result : Google.Apis.Requests.IDirectResponseSchema
    {
        [Newtonsoft.Json.JsonPropertyAttribute("cacheId")]
        public virtual string CacheId { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("displayLink")]
        public virtual string DisplayLink { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("fileFormat")]
        public virtual string FileFormat { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("formattedUrl")]
        public virtual string FormattedUrl { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("htmlFormattedUrl")]
        public virtual string HtmlFormattedUrl { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("htmlSnippet")]
        public virtual string HtmlSnippet { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("htmlTitle")]
        public virtual string HtmlTitle { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("image")]
        public virtual Result.ImageData Image { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("kind")]
        public virtual string Kind { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("labels")]
        public virtual System.Collections.Generic.IList<Result.LabelsData> Labels { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("link")]
        public virtual string Link { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("mime")]
        public virtual string Mime { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("pagemap")]
        public virtual System.Collections.Generic.IDictionary<string,System.Collections.Generic.IList<System.Collections.Generic.IDictionary<string,object>>> Pagemap { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("snippet")]
        public virtual string Snippet { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("title")]
        public virtual string Title { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
        

        public class ImageData
        {
            [Newtonsoft.Json.JsonPropertyAttribute("byteSize")]
            public virtual System.Nullable<int> ByteSize { get; set; } 

            [Newtonsoft.Json.JsonPropertyAttribute("contextLink")]
            public virtual string ContextLink { get; set; } 

            [Newtonsoft.Json.JsonPropertyAttribute("height")]
            public virtual System.Nullable<int> Height { get; set; } 

            [Newtonsoft.Json.JsonPropertyAttribute("thumbnailHeight")]
            public virtual System.Nullable<int> ThumbnailHeight { get; set; } 

            [Newtonsoft.Json.JsonPropertyAttribute("thumbnailLink")]
            public virtual string ThumbnailLink { get; set; } 

            [Newtonsoft.Json.JsonPropertyAttribute("thumbnailWidth")]
            public virtual System.Nullable<int> ThumbnailWidth { get; set; } 

            [Newtonsoft.Json.JsonPropertyAttribute("width")]
            public virtual System.Nullable<int> Width { get; set; } 

        }    

        public class LabelsData
        {
            [Newtonsoft.Json.JsonPropertyAttribute("displayName")]
            public virtual string DisplayName { get; set; } 

            [Newtonsoft.Json.JsonPropertyAttribute("label_with_op")]
            public virtual string LabelWithOp { get; set; } 

            [Newtonsoft.Json.JsonPropertyAttribute("name")]
            public virtual string Name { get; set; } 

        }
    }    

    public class Search : Google.Apis.Requests.IDirectResponseSchema
    {
        [Newtonsoft.Json.JsonPropertyAttribute("context")]
        public virtual Context Context { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("items")]
        public virtual System.Collections.Generic.IList<Result> Items { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("kind")]
        public virtual string Kind { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("promotions")]
        public virtual System.Collections.Generic.IList<Promotion> Promotions { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("queries")]
        public virtual System.Collections.Generic.IDictionary<string,System.Collections.Generic.IList<Query>> Queries { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("searchInformation")]
        public virtual Search.SearchInformationData SearchInformation { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("spelling")]
        public virtual Search.SpellingData Spelling { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("url")]
        public virtual Search.UrlData Url { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
        

        public class SearchInformationData
        {
            [Newtonsoft.Json.JsonPropertyAttribute("formattedSearchTime")]
            public virtual string FormattedSearchTime { get; set; } 

            [Newtonsoft.Json.JsonPropertyAttribute("formattedTotalResults")]
            public virtual string FormattedTotalResults { get; set; } 

            [Newtonsoft.Json.JsonPropertyAttribute("searchTime")]
            public virtual System.Nullable<double> SearchTime { get; set; } 

            [Newtonsoft.Json.JsonPropertyAttribute("totalResults")]
            public virtual System.Nullable<long> TotalResults { get; set; } 

        }    

        public class SpellingData
        {
            [Newtonsoft.Json.JsonPropertyAttribute("correctedQuery")]
            public virtual string CorrectedQuery { get; set; } 

            [Newtonsoft.Json.JsonPropertyAttribute("htmlCorrectedQuery")]
            public virtual string HtmlCorrectedQuery { get; set; } 

        }    

        public class UrlData
        {
            [Newtonsoft.Json.JsonPropertyAttribute("template")]
            public virtual string Template { get; set; } 

            [Newtonsoft.Json.JsonPropertyAttribute("type")]
            public virtual string Type { get; set; } 

        }
    }
}
